#ifndef _SERIAL_H_
#define _SERIAL_H_

#include "common/common.h"

namespace iecas_ns
{
    class CSerial
    {
        #define MAXDATASIZE 128

		public:
			static shared_ptr<CSerial> getInstance();
            CSerial();
			bool init(string srcDev);
            void start(void);
            void loop(void);
            bool deinit(string srcDev);
		private:
			static shared_ptr<CSerial> sm_intancePtr;
            string m_srcDev;
            int set_serial(int fd, int nSpeed, int nBits, char nEvent, int nStop);
            int open_port(const char device[]);       
            shared_ptr<CCommon> m_commonPtr;
    };
}

#endif